package com.szh.library.user.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.szh.common.result.Result;
import com.szh.model.Book;
import com.szh.vo.BookFindVo;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: SongZiHao
 * @date: 2023/7/4
 */
@FeignClient("service-library-book")
public interface BookFeignClient {

    @GetMapping(value = "/library/book/findBookById/{id}")
    Result<Book> findBookById(@PathVariable("id") Long id);

    @GetMapping(value = "/library/book/findAllBooks")
    Result<List<Book>> findAllBooks();

    @PostMapping(value = "/library/book/findBooksByConditionPage/{page}/{limit}")
    Result<Page<Book>> findBooksByConditionPage(@PathVariable("page") Long page,
                                                @PathVariable("limit") Long limit,
                                                @RequestBody(required = false) BookFindVo bookFindVo);
}
